//
//  CollectCell.m
//  HealthA段
//
//  Created by MrJXT on 15/6/11.
//  Copyright (c) 2015年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "CollectCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation CollectCell
- (void)dealloc
{
    [_nameLabel release];
    [_picView release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backView = [[UIImageView alloc]init];
        self.backView.layer.borderWidth = 1;
        self.backView.layer.cornerRadius = 18;
        self.backView.backgroundColor = [UIColor clearColor];
        self.backView.layer.masksToBounds = YES;
        [self.contentView addSubview:self.backView];
        self.backView.backgroundColor = [UIColor whiteColor];
        self.backView.alpha = 0.63;
        [_backView release];
        
        self.nameLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
        self.picView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.picView];
        self.picView.layer.borderWidth = 1;
        self.picView.layer.cornerRadius = 18;
        self.picView.layer.borderColor = [UIColor clearColor].CGColor;
        self.picView.layer.masksToBounds = YES;
        [_picView release];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.backView.frame = CGRectMake(5, 5, WIDTH - 10, HEIGHT - 10);
    
    self.picView.frame = CGRectMake(10, 10, 0.25 * WIDTH, HEIGHT - 20);
    
    self.nameLabel.frame = CGRectMake(0.25 *WIDTH + 10, 15, WIDTH - 0.25 *WIDTH - 10, 40);
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
